import { ref } from 'vue'
const icons = ref({})
uni.request({
	url: 'https://at.alicdn.com/t/c/font_3676216_i7lo2dyancf.css', // CSS 文件 URL
	method: 'GET',
	success: (response) => {
		const cssContent = response.data; // 获取 CSS 文件内容
		const regex = /(\.[\w\-]+):before\s*{\s*content:\s*"([^"]+)";\s*}/g;
		let matches = null;

		while ((matches = regex.exec(cssContent)) !== null) {
			icons.value[matches[1].substring(1)] = matches[2].replace('\\', '&#') + ';'; // 去掉类名前的点
		}
		console.log(icons.value); // 打印结果
	},
	fail: (error) => {
		console.error('Error fetching CSS file:', error);
	}
});

export default icons